//
//  LaunchScreenViewController.swift
//  iPhone
//
//  Created by Toj on 8/28/23.
//

import UIKit

// MARK: - 懒加载(属性), 变量, 初始化init
class LaunchScreenViewController: UIViewController {
    
    private lazy var imageView: UIImageView = {
        let view = UIImageView()
        view.contentMode = .scaleAspectFit
        view.image = "st_welcome_logo".img_resource
        return view
    }()
    
    private lazy var versionLabel: UILabel = {
        let view = UILabel()
        view.textColor = .black
        view.text = "Version 4.5"
        return view
    }()
}

// MARK: - 生命周期
extension LaunchScreenViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        CM.absoluteTimes {
            print(12456)
        }
        setupMakeInitialize()
        setupMakeAddSubviews()
        setupMakeLayoutSubviews()
    }
}

// MARK: - 初始化设置
private extension LaunchScreenViewController {
    
    func setupMakeAddSubviews() {
        
        view.addSubview(versionLabel)
        view.addSubview(imageView)
    }
    
    func setupMakeLayoutSubviews() {
        
        let top = CGFloat.sts_barHeight + 90
        imageView.snp.makeConstraints { make in
            make.centerX.equalTo(view)
            make.width.equalTo(250)
            make.height.equalTo(100)
            make.top.equalTo(top)
        }
        
        versionLabel.snp.makeConstraints { make in
            make.centerX.equalTo(imageView)
            make.top.equalTo(imageView.snp.bottom).offset(280)
        }
    }
    
    func setupMakeInitialize() {
        view.backgroundColor = .white
    }
}
